﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    public class tbl_Excessive
    {
        public bool Add(MODEL.tbl_Excessive s)
        {
            string strsql = "insert into tbl_Excessive(SensorID)" +
                           "values('{0}')";
            strsql = string.Format(strsql, s.SensorID);
            return DBUnlity.DBHelpSQL.ExeSql(strsql);
        }

        public bool ExistsExcessive(string id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(" select count(1) from  tbl_Excessive where SensorID=@id ");
            SqlParameter[] parameters = { 
                                        new SqlParameter("@id",SqlDbType.VarChar,150)
                                        };
            parameters[0].Value = id;
            return DBUnlity.DbHelperSQL.Exists(strSql.ToString(), parameters);
        }
    }
}
